const http = uni.$u.http
//测算人数
export const totalUser = (params) => {
	return uni.$u.http.post('/api/index/cesuan', params, {
		custom: {
			auth: true
		}
	});
}
export const setting = (params) => {
	return uni.$u.http.post('/api/index/get_setting', params, {
		custom: {
			auth: true
		}
	});
}
// 登录
export const loginApi = (params) => {
	return uni.$u.http.post('/api/index/login', params, {
		custom: {
			auth: false
		}
	});
}
// 获取灵异故事列表(帖子列表)
export const get_gushis_list = (params) => {
	return uni.$u.http.post('/api/gushis/get_gushis_list', params, {
		custom: {
			auth: true
		}
	});
}
//关注or取消用户
export const guanzhu_list = (params) => {
	return uni.$u.http.post('/api/gushis/guanzhu_list', params, {
		custom: {
			auth: true
		}
	});
}

//话题列表
export const huati_list = (params) => {
	return uni.$u.http.post('/api/index/huati_list', params, {
		custom: {
			auth: true
		}
	});
}

//关注状态
export const guanzhu_status = (params) => {
	return uni.$u.http.post('/api/gushis/guanzhu_status', params, {
		custom: {
			auth: true
		}
	});
}

//获取用户信息
export const user_info = (params) => {
	return uni.$u.http.post('/api/user/index', params, {
		custom: {
			auth: true
		}
	});
}
// 发布帖子
export const addoreditGushis = (params) => {
	return uni.$u.http.post('/api/gushis/addoredit_gushis', params, {
		custom: {
			auth: true
		}
	});
}
// 我的帖子
export const storyListAPI = (params) => {
	return uni.$u.http.post('/api/gushis/get_gushis_list', params, {
		custom: {
			auth: true
		}
	});
}
// 帖子详情
export const storyDetailAPI = (params) => {
	return uni.$u.http.post('/api/gushis/get_gushis_one', params, {
		custom: {
			auth: true
		}
	});
}
// 每日问答详情
export const answerDetailAPI = (params) => {
	return uni.$u.http.post('/api/index/get_asks_one', params, {
		custom: {
			auth: true
		}
	});
}
// 灵异故事评论列表
export const storyPinglunListAPI = (params) => {
	return uni.$u.http.post('/api/gushis/get_comment_list', params, {
		custom: {
			auth: true
		}
	});
}
//灵异故事点赞收藏
export const storyZanCangAPI = (params) => {
	return uni.$u.http.post('/api/gushis/set_zanhecang', params, {
		custom: {
			auth: true
		}
	});
}
//灵异故事取消点赞收藏
export const notstoryZanCangAPI = (params) => {
	return uni.$u.http.post('/api/gushis/set_zanhecang', params, {
		custom: {
			auth: true
		}
	});
}
//发布评论
export const addComment = (params) => {
	return uni.$u.http.post('/api/gushis/add_comment', params, {
		custom: {
			auth: true
		}
	});
}

// 删除我的帖子
export const deletestoryAPI = (params) => {
	return uni.$u.http.post('/api/gushis/shanchu', params, {
		custom: {
			auth: true
		}
	});
}
//优质评论
export const excellentComments = (params) => {
	return uni.$u.http.post('/api/index/excellent_comment', params, {
		custom: {
			auth: true
		}
	});
}
//测文分享
export const postShare = (params) => {
	return uni.$u.http.post('/api/user/get_divination_list', params, {
		custom: {
			auth: true
		}
	});
}
//点赞/收藏/分享
export const zanshare = (params) => {
	return uni.$u.http.post('/api/gushis/set_zanhecang', params, {
		custom: {
			auth: true
		}
	});
}
export const feedbackApi = (params) => {
	return uni.$u.http.post('/api/user/set_opinion', params, {
		custom: {
			auth: true
		}
	});
}

// 商城api
// 首页
// 找回密码
export const forgetPass = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/forget_password', params, config)
// 分类
export const shopCate = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/shop/cate', params, config)
// 获取二三级分类
export const cateList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/shop/catelist', params, config)
// 商品列表
export const goodList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/shop/goodlist', params, config)
// 商品详情页
export const goodDetail = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/shop/gooddetail', params, config)
// 商品规格展示
export const goodStock = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/shop/goodstock', params, config)
// 选择规格拿到商品库存id和价格
export const shopGetStock = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/shop/getstock', params, config)
// 商品收藏、取消收藏
export const cartCollect = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/cart/collect', params, config)
// 获取轮播图
export const getBanner = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/get_banner', params, config)
// 弹窗公告
export const Notice = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/notice', params, config)
// logo
export const getLogo = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/get_setting', params, config)


// 我的
// 收货地址列表
export const userAddressList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/addresslist', params, config)
// 收货地址详情
export const userAddressDetail = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/addressdetail', params, config)
// 收货地址添加编辑
export const userAddressEdit = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/addressedit', params, config)
// 收货地址设为默认
export const userAddressDefault = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/addressdefault', params, config)
// 收货地址删除
export const userAddressDel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/addressdel', params, config)
// 获取个人信息
export const userIndex = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/index', params, config)
// 修改用户信息
export const userUpdateUser = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/update_user', params, config)
// 重置登录密码
export const userUpdatePass = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/update_pass', params, config)
// 重置安全密码
export const userUpdateSecuri = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/update_securitypass', params, config)
// 资金搜索下拉数据获取
export const logSelect = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/log_select', params, config)
// 资金记录
export const userPriceLog = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/price_log', params, config)
// 收藏列表
export const userCollect = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/collect', params, config)
// 收藏-批量取消
export const userCollectcancel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/collectcancel', params, config)
// 绑定手机
export const userBindNewphone = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/bind_newphone', params, config)

// 提现
// 钱包-列表
export const userWallet = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/wallet', params, config)
// 钱包-添加
export const userSaveWallet = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/save_wallet', params, config)
// 钱包-列表
export const userWalletDel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/wallet_del', params, config)
// 提现-添加
export const userWithdrawal = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/withdrawal', params, config)
// 提现-列表
export const userWithdrawalList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/withdrawal_list', params, config)


// 充值
// 验证充值金额
export const userCheckRecharge = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/check_recharge', params, config)
// 获取转账通道
export const getRechargePayment = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/get_recharge_payment', params, config)
// 获取充值网络
export const getRechargeChannel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/get_recharge_channel', params, config)
// 充值-提交
export const userRecharge = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/recharge', params, config)
// 充值-列表
export const userRechargeList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/user/recharge_list', params, config)


// 购物车
// 加入购物车
export const cartAdd = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/cart/add', params, config)
// 购物车列表
export const cartLists = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/cart/lists', params, config)
// 编辑购物车
export const cartEdit = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/cart/edit', params, config)
// 删除(单个/批量)
export const cartDel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/cart/del', params, config)


// 订单
// 确认订单页
export const orderSubmit = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/submit', params, config)
// 提交订单
export const orderCreate = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/create', params, config)
// 订单支付-数据获取
export const orderPayinfo = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/payinfo', params, config)
// 订单支付-提交
export const orderPay = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/pay', params, config)
// 订单列表
export const orderLists = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/lists', params, config)
// 订单详情
export const orderDetail = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/detail', params, config)
// 取消订单
export const orderCancel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/cancel', params, config)
// 确认收货
export const orderConfirm = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/confirm', params, config)
// 删除订单
export const orderDelete = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/delete', params, config)
// 申请售后-数据获取
export const serviceGetorder = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/getorder', params, config)
// 申请售后-提交数据
export const serviceAdd = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/add', params, config)
// 售后列表
export const serviceLists = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/lists', params, config)
// 售后详情
export const serviceDetail = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/detail', params, config)
// 填写退货物流-数据提交
export const serviceDeliveryadd = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/deliveryadd', params, config)
// 填写退货物流-数据获取
export const serviceDelivery = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/delivery', params, config)
// 撤销售后申请
export const serviceCancel = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/cancel', params, config)
// 售后进度查询
export const serviceProcess = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/service/process', params, config)
// 查看物流
export const orderExpinfo = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/order/expinfo', params, config)

// 通用接口
// 获取配置
export const getSetting = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/index/get_setting', params, config)


// 优惠卷
// 新人礼包
export const couponGetNewList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/coupon/getNewList', params, config)
// 领取新人礼包
export const couponAddNew = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/coupon/addNew', params, config)
// 领卷中心
export const couponList = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/coupon/couponlist', params, config)
// 我的优惠卷
export const couponLists = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/coupon/lists', params, config)
// 领取优惠卷
export const couponAdd = (params, config = {
	custom: {
		auth: true
	}
}) => uni.$u.http.post('/api/coupon/add', params, config)
// 获取可使用的优惠卷
// export const couponLists=(params,config={custom: {auth: true}})=>http.post('/api/coupon/lists',params,config)
// 获取验证码
export const smsAPI = (params, config = {}) => http.post('/api/index/send_sms', params, config)
//我的收藏
export const collectAPI = (params) => {
	return uni.$u.http.post('/api/gushis/gushis_shoucang_list', params, {
		custom: {
			auth: true
		}
	});
}
/* 取消点赞/收藏 */
export const cancelGoodAPI = (params) => {
	return uni.$u.http.post('/api/gushis/set_zanhecang', params, {
		custom: {
			auth: true
		}
	});
}

// 获取验证码
export const getArticle = (params, config = {
	custom: {
		auth: true
	}
}) => http.post('/api/index/article', params, config)

/* 我的关注 */
export const my_guanzhu = (params) => {
	return uni.$u.http.post('/api/gushis/my_guanzhu_list', params, {
		custom: {
			auth: true
		}
	});
}
/* 被关注的人的帖子 */
export const userInfoAPI = (params) => {
	return uni.$u.http.post('/api/gushis/get_gushis_list', params, {
		custom: {
			auth: true
		}
	});
}

// 一键登录
export const newLoginApi = (params, config = {
	custom: {
		auth: false
	}
}) => http.post('/api/index/new_login', params, config)

/* 获取验证码 */
export const getyzcodeApi = (params, config = {
	custom: {
		auth: false
	}
}) => http.post('/api/index/send_sms', params, config)
/* 手机号+验证码注册 */
export const phonecodeApi = (params, config = {
	custom: {
		auth: false
	}
}) => http.post('/api/index/other_new_login', params, config)
